import { color } from '../config';
import * as THREE from 'three'
import { Points } from './points'
export class Road{
  constructor(scene,time,source,target){
    this.scene = scene
    this.time = time
    
    this.options = {
      range:200,
      height:300,
      color:color.road,
      size:30,
      len:400
    }
      // 
      const curve = new THREE.CatmullRomCurve3([
        new THREE.Vector3(-320,0,160),
        new THREE.Vector3(-150,0,-40),
        new THREE.Vector3(-10,0,-35),
        new THREE.Vector3(40,0,40),
        new THREE.Vector3(30,0,150),
        new THREE.Vector3(-100,0,310),
        new THREE.Vector3(-320,0,160),
      ])
      // 获取粒子
      const points = curve.getPoints(400) 
      new Points(scene, time).createPoints(this.options,points)
  }

}